function myAjax(url, data, type) {
    let temp = null;
    // data.username=localStorage.getItem("username");
    data.token = $.cookie("token");
    $.ajax({
        url: 'http://localhost:8081' + url,
        data: data,
        type: type,
        async: false,
        xhrFields: {
            withCredentials: true //允许跨域带Cookie
        },
        dataType: 'json',
        success: function (data) {
            // if (data[0].code == 400) {
            //     window.location.href = "/back/userLogin.jsp";
            // } else {
                temp = data;
            // }

        }
    })
    return temp;
}
